package UnOfficeDeTourisme;

/**
 * Interface definition : SGCatalogue
 * 
 * @author OpenORB Compiler
 */
public class _SGCatalogueStub extends org.omg.CORBA.portable.ObjectImpl
        implements SGCatalogue
{
    static final String[] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/SGCatalogue:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = UnOfficeDeTourisme.SGCatalogueOperations.class;

    /**
     * Operation creerCatalogue
     */
    public int creerCatalogue(UnOfficeDeTourisme.Catalogue cat)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("creerCatalogue",true);
                    UnOfficeDeTourisme.CatalogueHelper.write(_output,cat);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("creerCatalogue",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCatalogueOperations _self = (UnOfficeDeTourisme.SGCatalogueOperations) _so.servant;
                try
                {
                    return _self.creerCatalogue( cat);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation creerPrestation
     */
    public int creerPrestation(UnOfficeDeTourisme.Prestation pre, int idCatalogue, int[] visitesPresta)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("creerPrestation",true);
                    UnOfficeDeTourisme.PrestationHelper.write(_output,pre);
                    _output.write_long(idCatalogue);
                    UnOfficeDeTourisme.listeLongHelper.write(_output,visitesPresta);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("creerPrestation",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCatalogueOperations _self = (UnOfficeDeTourisme.SGCatalogueOperations) _so.servant;
                try
                {
                    return _self.creerPrestation( pre,  idCatalogue,  visitesPresta);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation consulterCat
     */
    public UnOfficeDeTourisme.Catalogue consulterCat(int idCatalogue)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("consulterCat",true);
                    _output.write_long(idCatalogue);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Catalogue _arg_ret = UnOfficeDeTourisme.CatalogueHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("consulterCat",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCatalogueOperations _self = (UnOfficeDeTourisme.SGCatalogueOperations) _so.servant;
                try
                {
                    return _self.consulterCat( idCatalogue);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation consulterpresta
     */
    public UnOfficeDeTourisme.Prestation consulterpresta(int idPresta)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("consulterpresta",true);
                    _output.write_long(idPresta);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Prestation _arg_ret = UnOfficeDeTourisme.PrestationHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("consulterpresta",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCatalogueOperations _self = (UnOfficeDeTourisme.SGCatalogueOperations) _so.servant;
                try
                {
                    return _self.consulterpresta( idPresta);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation consulterVisitesPresta
     */
    public int[] consulterVisitesPresta(int idPresta)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("consulterVisitesPresta",true);
                    _output.write_long(idPresta);
                    _input = this._invoke(_output);
                    int[] _arg_ret = UnOfficeDeTourisme.listeLongHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("consulterVisitesPresta",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCatalogueOperations _self = (UnOfficeDeTourisme.SGCatalogueOperations) _so.servant;
                try
                {
                    return _self.consulterVisitesPresta( idPresta);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation listerCat
     */
    public UnOfficeDeTourisme.Catalogue[] listerCat()
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("listerCat",true);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Catalogue[] _arg_ret = UnOfficeDeTourisme.listeCataloguesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("listerCat",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCatalogueOperations _self = (UnOfficeDeTourisme.SGCatalogueOperations) _so.servant;
                try
                {
                    return _self.listerCat();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation listerPresta
     */
    public UnOfficeDeTourisme.Prestation[] listerPresta(int idcat)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("listerPresta",true);
                    _output.write_long(idcat);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Prestation[] _arg_ret = UnOfficeDeTourisme.listePrestationsHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("listerPresta",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCatalogueOperations _self = (UnOfficeDeTourisme.SGCatalogueOperations) _so.servant;
                try
                {
                    return _self.listerPresta( idcat);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation vistesPresta
     */
    public int[] vistesPresta(int idpresta)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("vistesPresta",true);
                    _output.write_long(idpresta);
                    _input = this._invoke(_output);
                    int[] _arg_ret = UnOfficeDeTourisme.listeLongHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("vistesPresta",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGCatalogueOperations _self = (UnOfficeDeTourisme.SGCatalogueOperations) _so.servant;
                try
                {
                    return _self.vistesPresta( idpresta);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
